package com.app.controller;


import com.app.ryjy.model.GeneralDic;
import com.app.service.IGeneralDicService;
import com.app.util.Result;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yoominic
 * @since 2024-10-31
 */
@RestController
@RequestMapping("/generalDic")
public class GeneralDicController {


    @Autowired
    private IGeneralDicService generalDicService;

    @GetMapping("/getGeneralDic")
    public Result getGeneralDic(String dicType) {
        QueryWrapper<GeneralDic> queryWrapper = new QueryWrapper<GeneralDic>();
        queryWrapper.eq("dic_type", dicType);
        queryWrapper.orderByAsc("id");
        List<GeneralDic> generalDics = generalDicService.list(queryWrapper);
        return Result.success(generalDics);
    }







}

